<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link th:href="@{/statics/css/fenye.css}" type="text/css" rel="stylesheet">
    <script th:src="@{/statics/未压缩版.js}" type="text/javascript"></script>
    <script th:src="@{/statics/js/indexPro.js}" type="text/javascript"></script>


</head>
<body>
<div>
    <a th:href="@{'/user/limit'}">跳转到用户页面</a>
</div>
<div class="table">
    <div class="pro" th:object="${page}">
        <h2>分页展示用户信息</h2>
        <div class="search" style="margin:20px">
            <form method="get" th:action="@{/pro/limitPro}">
                <input type="hidden" id="totalPage" th:value="*{totalPage}">
                <label for="name">商品名称：</label>
                <input name="proName" type="text" id="name"  th:value="${proName}">
                <input type="submit" name="searchbutton" value="查询">
                <input type="button" value="添加用户" id="toAdd">
            </form>
        </div>

        <table>
            <tr>
                <th>序号</th>
                <th>供应商编码</th>
                <th>供应商名称</th>
                <th>供应商详细描述 </th>
                <th>操作</th>
            </tr>
            <tr th:each="pro:*{data}">
                <td th:text="${pro.id}"></td>
                <td th:text="${pro.proCode}"></td>
                <td th:text="${pro.proName}"></td>
                <td th:text="${pro.proDesc}"></td>
                <td>
                    <a th:href="@{'/pro/toProView?id='+${pro.id}}">查看</a>
                    <a th:href="@{'/pro/toProUpdate?id='+${pro.id}}">修改</a>
                    <a th:href="@{'/pro/toDelPro?id='+${pro.id}}">删除</a>
                    <a class="chakan" th:attr="proId=${pro.id}">restful查看</a>
                </td>
            </tr>
        </table>
        <nav class="selectPage" th:if="*{totalPage>0}">

            <div>
                当前<span th:text="${page.currentPageNo}"></span>页,
                共<span th:text="${page.totalPage}"></span>页,
                共<span th:text="${page.totalConut}"></span>条记录
            </div>
            <div>
                <span th:if="*{currentPageNo>1}">
                     <a href="/pro/limitPro?currentPageNo=1">首页</a>
                    <a th:href="@{'/pro/limitPro?currentPageNo='+*{currentPageNo - 1}}">上一页</a>
                </span>
                <span th:if="*{currentPageNo<totalPage}">
                    <a th:href="@{'/pro/limitPro?currentPageNo='+*{currentPageNo + 1}}">下一页</a>
                    <a th:href="@{'/pro/limitPro?currentPageNo='+*{totalPage}}">尾页</a>
                </span>
                <span>
                    <input type="button" value="跳转到" id="go">
                    <input type="text" name="count" id="aa"  style="width: 50px"> 页
                </span>

            </div>
        </nav>
        <div id="show"></div>
    </div>

</div>

</body>
</html>